package com.test.noahphan;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {
	Button btn;
	EditText editUser;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		editUser = (EditText) findViewById(R.id.editUser);
		btn = (Button) findViewById(R.id.btn_hello);
		Toast toast = Toast.makeText(this, "Using Toast on Android", 1000);
		toast.show();
		btn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Bundle b = new Bundle();
				b.putString("1", editUser.getText().toString());
				Intent it = new Intent(getApplicationContext(), Hello.class);

				it.putExtras(b);

				startActivity(it);

				// Intent it2 = new Intent(getApplicationContext(),
				// ChangeDF.class);
				// startActivity(it2);

			}
		});

		((Button) findViewById(R.id.btnAlarm))
				.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {
						Intent i = new Intent(getApplicationContext(),
								Alarm.class);
						startActivity(i);

					}
				});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
